package com.demo.controller;

import com.demo.pojo.User;
import com.demo.server.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping("/findone")
    public User findUser(Long id) {
        return userService.findUser(id);
    }

    @RequestMapping("/findall")
    public List<User> findUserList() {
        return userService.findUserList();
    }
}
